$(function(){
	var parm = $("#tabContent > .tab-pane.active").data();
	var data = parm.data;

	var thead='<table id="outCaseTable-sub" class="table table-striped" style="width:100%;">';
	thead+='<thead>';
	thead+='	<tr>';
	thead+='		<th>病案号</th>';
	thead+='		<th>姓名</th>';
	thead+='		<th>性别</th>';
	thead+='		<th>年龄</th>';
	thead+='		<th>入院时间</th>';
	thead+='		<th>出院时间</th>';
	thead+='		<th>出院科室</th>';
	thead+='		<th>住院日</th>';
	thead+='		<th>总费用(元)</th>';
	thead+='		<th>药品费用(元)</th>';
	thead+='		<th>主诊断</th>';
	thead+='		<th>DRG代码</th>';
	thead+='		<th>DRG描述</th>';
	thead+='		<th>病组权重</th>';
	thead+='		<th>平均住院日(绩效值)</th>';
	thead+='		<th>次均费用(元)(绩效值)</th>';//22,23行换位置
	thead+='	</tr>';
	thead+='</thead>';
	thead+='<tbody></tbody></table>';
	$("#"+tabId+" #outCaseTable").html(thead);
	var columns=[ 
                 {
						"data" : "mr_no",
						"render" : function(obj, type, full) {
							return "<a href=\"javascript:medicalRecord('"+full[0]+"','"+full[2]+"')\">"+full[1]+"</a>";
						}
                 },
                 {
						"data" : "name",
						"render" : function(obj, type, full) {
							return full[2];
						}
                 },
                 {
						"data" : "sex",
						"render" : function(obj, type, full) {
							return full[3];
						}
                 },
                 {
						"data" : "age",
						"render" : function(obj, type, full) {
							return full[4];
						}
                 },
                 {
						"data" : "in_date",
						"render" : function(obj, type, full) {
							return full[5];
						}
                 },
                 {
						"data" : "out_date",
						"render" : function(obj, type, full) {
							return full[6];
						}
                 },
                 {
						"data" : "out_dep",
						"render" : function(obj, type, full) {
							return full[7];
						}
                 },
                 {
						"data" : "in_days",
						"render" : function(obj, type, full) {
							return full[8];
						}
                 },
                 {
						"data" : "costamount",
						"render" : function(obj, type, full) {
							return full[9];
						}
                 },
                 {
						"data" : "drugcost",
						"render" : function(obj, type, full) {
							return full[10];
						}
                 },
                 {
						"data" : "diagnose_dess_main",
						"render" : function(obj, type, full) {
							return full[11];
						}
                 },
                 {
						"data" : "drg_code",
						"render" : function(obj, type, full) {
							return full[12];
						}
                 },
                 {
						"data" : "drg_desc",
						"render" : function(obj, type, full) {
							return full[13];
						}
                 },
                 {
						"data" : "as_weight",
						"render" : function(obj, type, full) {
							return full[14];
						}
                 },
                 {
						"data" : "as_avg_days",
						"render" : function(obj, type, full) {
							return full[15];
						}
                 },
                 {
						"data" : "as_avg_fee",
						"render" : function(obj, type, full) {
							return full[16];
						}
                 }
                 ];
	var paramsDataTables={stateSave:true,pageLength:50,columnDefs:[{ "orderable": false, "targets": [ 0 ] }],lengthMenu:[[ 50,100,500, 1000,99999],[ 50,100,500, 1000,'全部']]};
	$("#"+tabId+" #outCaseTable-sub").dataTableBasic(columns,data,paramsDataTables);
	

});
